added flow chart and updated validate.class.php