 
 import UIKit
 
+// MARK: - Position
 public struct Position {
     let row: Int
     let column: Int
 }
 
+// MARK: - NumPadDataSource
 public protocol NumPadDataSource: class {
-    
     func numberOfRowsInNumberPad(numPad: NumPad) -> Int
     func numPad(numPad: NumPad, numberOfColumnsInRow row: Int) -> Int
-    func numPad(numPad: NumPad, titleForButtonAtPosition position: Position) -> String
-    func numPad(numPad: NumPad, titleColorForButtonAtPosition position: Position) -> UIColor
-    func numPad(numPad: NumPad, fontForButtonAtPosition position: Position) -> UIFont
-    func numPad(numPad: NumPad, imageForButtonAtPosition position: Position) -> UIImage
-    func numPad(numPad: NumPad, backgroundColorForButtonAtPosition position: Position) -> UIColor
-    func numPad(numPad: NumPad, backgroundHighlightedColorForButtonAtPosition position: Position) -> UIColor
-    
-}
-
-extension NumPadDataSource {
-    
-    
-    
-}
-
+    func numPad(numPad: NumPad, buttonForPosition position: Position) -> UIButton
+}
+
+// MARK: - NumPadDelegate
 public protocol NumPadDelegate: class {
-    
-    func numPad(numPad: NumPad, didSelectButtonAtIndexPath indexPath: NSIndexPath)
-    
+    func numPad(numPad: NumPad, buttonTappedAtPosition position: Position)
 }
 
 extension NumPadDelegate {
-    
-    func numPad(numPad: NumPad, didSelectButtonAtIndexPath indexPath: NSIndexPath) {}
-    
-}
-
+    func numPad(numPad: NumPad, buttonTappedAtPosition position: Position) {}
+}
+
+// MARK: - NumPad
 public class NumPad: UIView {
 
     let collectionView = UICollectionView()
     
-    weak public var delegate: NumPadDataSource?
-    weak public var dataSource: NumPadDelegate?
+    weak public var dataSource: NumPadDataSource?
+    weak public var delegate: NumPadDelegate?
     
     required public init?(coder aDecoder: NSCoder) {
         super.init(coder: aDecoder)

    func setup() {
        button.translatesAutoresizingMaskIntoConstraints = false
        button.titleLabel?.textAlignment = .Center
        contentView.addSubview(button)
        
        let views = ["button": button]

    }
    
    func numberOfRows() -> Int {
        return dataSource?.numberOfRowsInNumberPad(self) ?? 0
    }
    
    func numberOfColumnsInRow(row: Int) -> Int {
        return dataSource?.numPad(self, numberOfColumnsInRow: row) ?? 0
    }
    
}

// MARK: - CellDelegate
protocol CellDelegate: class {
    func cell(cell: Cell, buttonTapped button: UIButton)
}

// MARK: - Cell
class Cell: UICollectionViewCell {
    
    let button = UIButton(type: .Custom)
    
    weak var delegate: CellDelegate?
    
    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
