Did the second part but it doesn't work just yet...for some reason, there is an unexpected issue with the caesar code even though it worked fine before.  I get the right period with the Friedman's test (a modified version where the IoC is computed using random sampling), and the format of the output is correct.