working simple analysis

This is the simple non-object-based vesion of the code. From here it
will fork to the object-based version, likely.