cleaned up code, fixed ticket mailer bug