third table NaN validation

Clean up & comment js code