John's validity function