better validation code
Very Big update