Simplified logic of validation checking
Added a space to docstring