Early version of Purity for testing idea.