Final cleaned up code with field and e-mail validation