broke tenplateToArray  code out from stitch