some of the basic code for email alerts added