Fixed the initialization array indexing procedures

Also implemented a final tree building routine to
make use of the optimal number of parameters for each
branch. Tomorrow I will get around to building and
using the treestring that is required to actually
use these parameters in the optimizer.