Added email gathering code