     }
     
     private func layoutTabButtons(buttons: Array<TabButton>?, animated anim: Bool) {
-        
+        let tabButtons = (buttons != nil) ? buttons! : self.tabButtons()
+        var tabsViewWidth = CGFloat(0.0)
+        
+        let fullSizeWidth = CGRectGetWidth(self.scrollView!.frame) / CGFloat(tabButtons.count)
+        let buttonHeight = CGRectGetHeight(self.tabsView!.frame)
+        
+        for (index, button) in tabButtons.enumerate() {
+            var buttonWidth = (self.preferFullWidthTabs == true) ? fullSizeWidth : min(self.maxTabWidth, fullSizeWidth)
+            buttonWidth = max(buttonWidth, self.minTabWidth)
+            let r = CGRectMake(CGFloat(index)*buttonWidth, 0.0, buttonWidth, buttonHeight)
+            
+            if anim == true && button.hidden == false {
+                button.animator().frame = r
+            }
+            else {
+                button.frame = r
+            }
+            
+            if let delegateReceiver = self.delegateInterceptor.receiver as? TabsControlDelegate {
+                if delegateReceiver.tabsControl?(self, canSelectItem: button.tabButtonCell!.representedObject!) != nil {
+                    button.tabButtonCell!.selectable = delegateReceiver.tabsControl!(self, canSelectItem: button.tabButtonCell!.representedObject!)
+                    // not entirely sure this swift code does what I want...
+                }
+            }
+            
+            button.tag = index
+            tabsViewWidth += buttonWidth
+        }
+        
+        self.tabsView!.frame = CGRectMake(0.0, 0.0, tabsViewWidth, buttonHeight)
     }
     
     private func updateAuxiliaryButtons() {
-        
+        let contentView = self.scrollView!.contentView
+        var showScrollButtons = (contentView.subviews.count > 0) && (NSMaxX(contentView.subviews[0].frame) > NSWidth(contentView.bounds))
+        showScrollButtons = showScrollButtons || (self.preferFullWidthTabs == true && self.currentTabWidth() == self.minTabWidth)
+        
+        
+        self.scrollLeftButton?.hidden = !showScrollButtons
+        self.scrollRightButton?.hidden = !showScrollButtons
+        if showScrollButtons == true {
+            self.scrollLeftButton?.enabled = self.visibilityCondition(self.scrollLeftButton!, forLeft: true)
+            self.scrollRightButton?.enabled = self.visibilityCondition(self.scrollRightButton!, forLeft: false)
+        }
     }
 
     // MARK: ScrollView Observation

    private var hideScrollButtons: Bool = true
    private var isHighlighted: Bool = false

    @IBOutlet public weak var dataSource: TabsControlDataSource?
    @IBOutlet public weak var delegate: TabsControlDelegate?
    
    public weak var selectedItem: AnyObject? = nil
    

            buttonCell.borderMask = borderMask
            
            button.title = dataSource.tabsControl(self, titleForItem: item)
            button.state = (item === self.selectedItem) ? NSOnState : NSOffState // yes triple === to check for instances
            button.highlight(self.isHighlighted)
            
            if let img = dataSource.tabsControl?(self, iconForItem: item) {
