fixed validation, added code to send email
finished adding functionality joan wanted