adds back validation function, mostly for testing. some of this is working.