Fixed InsertionAnalysis. Cleaned up code.

Should be ready to turn in.