Main validation code complete