added email function incomplete