Pseudo-coded validate()