Finished chunking on output

Need to implement ChiSqr value writing, then optimize matrix calcs.