Added std deviation calculation. Added simulation diagnostics.