added loop for listing valid email addresses