Slightly changed logic of when to replace old tuple in map, and send email after the entire file is parsed