Copy of old validator script