moved some things around, and created a testing mode so emails are not sent while testing