part of validation code for illustration