validateInput formatted as code for consistency.

also fixed minor typo.