         tidbits: @tidbits
       }
     save: () ->
-      robot.brain.data.factoids[@name] = @toObj()
+      robot.brain.data.factoids[@name] = @to_obj()
 
 
   class FactoidHandler
     constructor: () ->
+      @stats = {}
       @facts = {}
       robot.brain.on 'loaded', (data) =>
         @facts = {}

        msg.send "I am " + output
      else
        msg.send [factoid.name, tidbit.verb, output].join ' '

  robot.factoid = new FactoidHandler


          return true
        if "edit_factoid_" + @name in user.roles
          return true
      if @readonly
        return false
      return true
    tidbit: () ->
      @tidbits[Math.floor(Math.random() * @tidbits.length)]
    add_tidbit: (tidbit, verb) ->
      # FIXME - add validation
      @tidbits.push {
        tidbit: tidbit,
        verb: verb
      }

    to_obj: () ->
      if @alias
        return {
          alias: @alias
