adding error messages and basic email calculation