more succinct valid function