implementation of purity verification complete. There may still be some bugs left... testing will help