added some proof checking and instantiation cade