Added the IF statement for the validation

Added the IF statement for the validation process of the code.  When
tested, didn’t run…got isNan is not defined error in the console.  need
to add ELSE…