 				{
 					var offsetY : CGFloat = 9
 					
-					if KeyboardViewController.getDeviceType() == TTDeviceType.TTDeviceTypeIPhone4
-					{
-						offsetY = 9
-						if self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeRight
-						{
-							offsetY = 3
-						}
-					}
-					else if KeyboardViewController.getDeviceType() == TTDeviceType.TTDeviceTypeIPhone5
-					{
-						offsetY = 9
-						if self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeRight
-						{
-							offsetY = 3
-						}
-						
-					}
-					else if KeyboardViewController.getDeviceType() == TTDeviceType.TTDeviceTypeIPhone6
-					{
-						offsetY = 13
-						if self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeRight
-						{
-							offsetY = 3
-						}
-						
-					}
-					else if KeyboardViewController.getDeviceType() == TTDeviceType.TTDeviceTypeIPhone6p
-					{
-						offsetY = 16
-						if self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeRight
-						{
-							offsetY = 3
-						}
-					}
+                    if self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeLeft || self.currentInterfaceOrientation == UIInterfaceOrientation.LandscapeRight {
+                        offsetY = 3
+                    }
+                    else {
+                        switch  KeyboardViewController.getDeviceType() {
+                        case TTDeviceType.TTDeviceTypeIPhone4, TTDeviceType.TTDeviceTypeIPhone5:
+                            offsetY = 9
+                            
+                        case TTDeviceType.TTDeviceTypeIPhone6:
+                            offsetY = 13
+                            
+                        case TTDeviceType.TTDeviceTypeIPhone6p:
+                            offsetY = 16
+                        }
+                    }
 					
 					self.button.removeFromSuperview()
 					

    
    func shiftDoubleTapped(sender: KeyboardKey) {
        self.shiftWasMultitapped = true
        
        switch self.shiftState {
        case .Disabled:
            self.shiftState = .Locked
        case .Enabled:
            self.shiftState = .Locked
        case .Locked:
            self.shiftState = .Disabled
        }
    }
    
    func updateKeyCaps(uppercase: Bool) {

    }
    
    func stringIsWhitespace(string: String?) -> Bool {
        return string != nil && string!.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) != ""
    }
    
    func shouldAutoCapitalize() -> Bool {
