Added DOC. Validation function