         return menuItem.button as! T
     }
 
-    public func removeMenuItem(position: MenuItemPositon) {
-        let index = menuItems.indexOf { (element) in
-            return element.positon == position
-        }
-        if let index = index {
+    public func removeMenuItem(position: MenuItemPosition) {
+        if let index = indexOfMenuItemAtPosition(position) {
             let menuItem = menuItems[index]
             animateMenuItemIn(menuItem)
             menuItems.removeAtIndex(index)
-        }
-    }
-    
-    func tappedMenuItem(menuItem: UIButton) {
-        if let position = MenuItemPositon(rawValue: menuItem.tag) {
-            tappedMenuItem?(menuItem.titleForState(.Normal)!, position)
         }
     }
     

        state = .Closed
    }
    
    func animateMenuItemOut(menuItem: MenuItem) {
        let point = calculateMenuItemPoint(menuItem.positon)
        UIView.animateWithDuration(0.4, delay: 0, usingSpringWithDamping: 0.8, initialSpringVelocity: 0.6, options: .CurveEaseInOut, animations: { () -> Void in
            menuItem.button.transform = CGAffineTransformMakeTranslation(point.x, point.y)
            }, completion: nil)

    func animateMenuItemIn(menuItem: MenuItem) {
        UIView.animateWithDuration(0.4, delay: 0, usingSpringWithDamping: 1, initialSpringVelocity: 0.4, options: .CurveEaseInOut, animations: { () -> Void in
            menuItem.button.transform = CGAffineTransformIdentity
            }, completion: { (finished) -> Void in
                menuItem.button.hidden = true
        })
    }
    
    func calculateMenuItemPoint(position: MenuItemPosition) -> CGPoint {
        let π = M_PI
        let angle: Double = (distanceBetweenMenuItems * Double(position.rawValue))
        let cosine = cos(angle / Double(180.0) * π)
        let sine = sin(angle / Double(180.0) * π)
        let deltaY: Double = -distanceFromCenter * cosine
        let deltaX: Double = distanceFromCenter * sine
        let point = CGPoint(x: deltaX, y: deltaY)
        return point
    }
    
    func addButtonConstraints(button: UIButton, size: CGSize) {
        NSLayoutConstraint.activateConstraints([
            NSLayoutConstraint(item: button, attribute: .Width, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: size.width),
            NSLayoutConstraint(item: button, attribute: .Height, relatedBy: .Equal, toItem: nil, attribute: .NotAnAttribute, multiplier: 1, constant: size.height),
            NSLayoutConstraint(item: button, attribute: .CenterX, relatedBy: .Equal, toItem: centerButton, attribute: .CenterX, multiplier: 1, constant: 1),
            NSLayoutConstraint(item: button, attribute: .CenterY, relatedBy: .Equal, toItem: centerButton, attribute: .CenterY, multiplier: 1, constant: 1)
            ])
    }
    
    func indexOfMenuItemAtPosition(position: MenuItemPosition) -> Int? {
        var indexOfMenuItem: Int?
        for (index, menuItem) in enumerate(menuItems) {
            if menuItem.position == position {
                indexOfMenuItem = index
                break
            }
        }
        return indexOfMenuItem
    }
    
    func menuItemButtonTapped(button: UIButton) {
        let menuItem = menuItems.filter {
            $0.button == button
            }.first
        if let menuItem = menuItem {
            delegate?.menuItemTapped(menuItem)
        }
    }
    
