Validation rewrite

Finished validation rewrite