Fixed simulation and some indexing

I had missed a scaling factor for the smoothed images from the MATLAB
script.

Discovered some incorrect indexing too.  Script now correct, but needs
more text.