                         var key = keyboard[i][j]
                         
                         var keyView = KeyboardKey(frame: CGRectMake(0, 0, 26, 39)) // TODO:
-                        let keyViewName = "key\(i)x\(j)"
+                        let keyViewName = "key\(j)x\(i)"
                         keyView.enabled = true
                         keyView.setTranslatesAutoresizingMaskIntoConstraints(false)
                         keyView.text = key

    
    func addEdgeConstraints() {
        let spacers = [
            "leftSpacer": Spacer(),
            "rightSpacer": Spacer(),
            "topSpacer": Spacer(),
            "bottomSpacer": Spacer()]
        
        // basic setup
        for (name, spacer) in spacers {
            spacer.setTranslatesAutoresizingMaskIntoConstraints(false)
            spacer.layer.backgroundColor = UIColor.redColor().CGColor
            self.elements[name] = spacer
            self.view.addSubview(spacer)
        }

                    item: keyGap,
                    attribute: NSLayoutAttribute.CenterY,
                    relatedBy: NSLayoutRelation.Equal,
                    toItem: self.elements["key\(0)x\(i)"],
                    attribute: NSLayoutAttribute.CenterY,
                    multiplier: 1,
                    constant: 0))
