covariance example now runs to completion. Need to confirm results and clean up code.
code cleanup
code cleanup