Added form validation, storeData and clearData functions