The ticket rules for writing into the database and creating tickets in invaluable.