Analysis code useful for many purposes.