worked on emailing function and fixed some of the views