 
 module.exports = (robot) ->
 
+  db = robot.brain.get 'cah' || {
+    scores:         {},                   # {<name>: <score>, ...}
+    activePlayers:  [],                   # [<player name>, ...]
+    blackCard:      random_black_card(),  # <card text>
+    czar:           null,                 # <player name>
+    hands:          {},                   # {<name>: [<card text>, <card text>, ...], ...}
+    answers:        [],                   # [ [<player name>, [<card text>, ...]], ... ]
+  }
+  robot.brain.set 'cah', db
+
   robot.hear /^cah help$/i, (msg) ->
     msg.send helpSummary
 
-  robot.hear /cah join$/i, (msg) ->
+  robot.hear /^cah join$/i, (msg) ->
     name = sender(msg)
     add_player(name)
     msg.reply "You are now an active CAH player."
 
-  robot.hear /cah leave$/i, (msg) ->
+  robot.hear /^cah leave$/i, (msg) ->
     name = sender(msg)
     remove_player(name)
     msg.reply "You are no longer a CAH player. Your score will be preserved should you decide to play again."
 
-  robot.hear /cah czar$/i, (msg) ->
+  robot.hear /^cah czar$/i, (msg) ->
     if db.czar?
       msg.send db.czar
     else
       msg.send "No Card Czar yet, waiting for players."
 
-  robot.hear /cah players$/i, (msg) ->
+  robot.hear /^cah players$/i, (msg) ->
     if db.activePlayers.length < 1
       msg.send "Waiting for players."
     else

      submit_answer(sender(msg), nums)
      msg.reply "Submission accepted."

  robot.hear /cah answers$/i, (msg) ->
    if sender(msg) != db.czar
      msg.reply "Only the Card Czar may see the white card submissions."
    else

      responseString += "\n#{scoreTuples[i][1]} #{scoreTuples[i][0]}"
    msg.send responseString

  robot.hear /^cah score$/i, (msg) ->
    score = db.scores[sender(msg)]
    if score?
      msg.reply score
    else
      msg.reply "No CAH score on record."

  robot.hear /^cah (hand|cards)$/i, (msg) ->
    cards = db.hands[sender(msg)]
    responseString = "Your white CAH cards:"
    if cards?
