Fixed problem with DB inserts, completed automated emailing, added additional information to 'edit' template