     self.y = y
   }
 
-  func prepareKey(string: String) -> String {
+  func prepareKey(c: UInt16) -> String {
     // Incredibly, long interpolation statements with the code below was causing
     // memory leaks in Swift when in release mode. So we refactored it into this
     // method and broke the statements into smaller blocks in order to appease


    defer { TTF_Quit() }

    let fontPath = "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf"

    let freeSans = TTF_OpenFont(fontPath, 12)


        "," +
        String(bg.a) +
        "."
    }
    k += String(c)
    return k
  }

  public func add(string: String) {
    for c in string.utf16 {
      let k = prepareKey(c)
      var value = cache[k]
      if value == nil {
        let surface = backgroundColor != nil ?
          TTF_RenderGlyph_Shaded(font, c, fontColor, backgroundColor!) :
          TTF_RenderGlyph_Blended(font, c, fontColor)
        defer { SDL_FreeSurface(surface) }
        value = TextureCacheValue(
            texture: SDL_CreateTextureFromSurface(renderer, surface),
            width: surface.memory.w, timestamp: 1)
        cache[k] = value
      }
      var destRect = SDL_Rect(x: padding + (Int32(x) * cellWidth),
          y: padding + (Int32(y) * cellHeight), w: value!.width, h: cellHeight)
      SDL_RenderCopy(renderer, value!.texture, nil, &destRect)
      x += 1
      value!.timestamp = 1
    }
  }

  public func changeScreenSize(width: Int32, height: Int32) {
