         }else{
             self.layoutIfNeeded()
         }
-        
-        print(self.bounds)
-        print(self.frame)
-        
-        print(self.theSuperView.bounds)
-        print(self.theSuperView.frame)
-    }
-    
-    private func addHeightAndWidthToPedal(thePedal: UIView) {
+    }
+    
+    private func constrainPedal(thePedal: UIView, pedalSubViews: [String: AnyObject]){
+        
+        var arrayOfConstraint = [NSLayoutConstraint]()
+        
+        let imageLabelVertical = NSLayoutConstraint.constraintsWithVisualFormat("V:|[image][label]|", options: [], metrics: nil, views: pedalSubViews)
+        
+        let imageHorizontal = NSLayoutConstraint.constraintsWithVisualFormat("H:|-(>=0)-[image]-(>=0)-|", options: [], metrics: nil, views: pedalSubViews)
+
+        guard let theImage = pedalSubViews["image"] as? UIImageView, let label = pedalSubViews["label"] as? UILabel else {
+            return
+        }
+        
+        if self.showPedalLabels == false {
+            let labeHeight = NSLayoutConstraint(item: label, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.Height, multiplier: 1.0, constant: 0)
+            arrayOfConstraint.append(labeHeight)
+        }
+
+        let moreImageHorizontal = NSLayoutConstraint(item: theImage, attribute: NSLayoutAttribute.CenterX, relatedBy: NSLayoutRelation.Equal, toItem: thePedal, attribute: NSLayoutAttribute.CenterX, multiplier: 1.0, constant: 0)
+        
+        let labelHorizontal = NSLayoutConstraint.constraintsWithVisualFormat("H:|[label]|", options: [], metrics: nil, views: pedalSubViews)
+        
+        arrayOfConstraint.appendContentsOf(imageLabelVertical)
+        arrayOfConstraint.appendContentsOf(imageHorizontal)
+        arrayOfConstraint.append(moreImageHorizontal)
+        arrayOfConstraint.appendContentsOf(labelHorizontal)
+        thePedal.addConstraints(arrayOfConstraint)
+    }
+    
+    private func constrainPedal(thePedal: UIView) {
         
         var arrayOfConstraints = [NSLayoutConstraint]()
         
         
-        let width = NSLayoutConstraint.constraintsWithVisualFormat("H:[view(50)]", options: [], metrics: nil, views: ["view":thePedal])
-        let height = NSLayoutConstraint.constraintsWithVisualFormat("V:[view(50)]", options: [], metrics: nil, views: ["view":thePedal])
-        //        let horizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("H:|[view]|", options: [], metrics: nil, views: ["view":thePedal])
-        //        let verticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|[view]|", options: [], metrics: nil, views: ["view":thePedal])
-        //        arrayOfConstraints.appendContentsOf(horizontalConstraints)
-        //        arrayOfConstraints.appendContentsOf(verticalConstraints)
-        arrayOfConstraints.appendContentsOf(width)
-        arrayOfConstraints.appendContentsOf(height)
-        
-        self.theSuperView.addConstraints(constraints)
-        
-        self.setNeedsLayout()
-        self.layoutIfNeeded()
+        let centerX = NSLayoutConstraint(item: thePedal, attribute: NSLayoutAttribute.CenterX, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.CenterX, multiplier: 1.0, constant: 0)
+        
+        let centerY = NSLayoutConstraint(item: thePedal, attribute: NSLayoutAttribute.CenterY, relatedBy: NSLayoutRelation.Equal, toItem: self, attribute: NSLayoutAttribute.CenterY, multiplier: 1.0, constant: 0)
+        
+        arrayOfConstraints.append(centerX)
+        arrayOfConstraints.append(centerY)
+        
+        self.addConstraints(arrayOfConstraints)
         
     }
     

        self.menuIsExpanded = false
    }
    
    internal func didTapPopOutView(sender: UITapGestureRecognizer) {
        for key in self.pedalIDs.keys {
            let view = self.pedalIDs[key]

            arrayOfConstraints.appendContentsOf(horizontalConstraints)
            arrayOfConstraints.appendContentsOf(verticalConstraints)
            print("Constrain To Upper Left")
            self.startAngle = 90
        case .UpperRight:
            let horizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("H:[me]-28-|", options: [], metrics: nil, views: ["me": self])
            let verticalConstraints = NSLayoutConstraint.constraintsWithVisualFormat("V:|-28-[me]", options: [], metrics: nil, views: ["me":self])
            arrayOfConstraints.appendContentsOf(horizontalConstraints)
            arrayOfConstraints.appendContentsOf(verticalConstraints)
            self.startAngle = 180
            print("Constrain To Upper Right")
        }
        
        let width = NSLayoutConstraint(item: self, attribute: NSLayoutAttribute.Width, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.Width, multiplier: 1.0, constant: 50)
        let height = NSLayoutConstraint(item: self, attribute: NSLayoutAttribute.Height, relatedBy: NSLayoutRelation.Equal, toItem: nil, attribute: NSLayoutAttribute.Height, multiplier: 1.0, constant: 50)
        arrayOfConstraints.append(width)
        arrayOfConstraints.append(height)
        
        self.theSuperView.addConstraints(arrayOfConstraints)
        self.setNeedsLayout()
