Added new versions of the script with form validation