         let offsetX: CGFloat = sqrt(pow(arcRadius, 2) - pow((closestHorizontalDistanceToEdge - (marginX + buttonRadius)), 2))
         let offsetY: CGFloat = sqrt(pow(arcRadius, 2) - pow((closestVerticalDistanceToEdge - (marginY + buttonRadius)), 2))
         
-        if (closestHorizontalDistanceToEdge == touchPointInset.left) {
-            
-        }
-        
-        var fromPoint: CGPoint = CGPoint(x: point.x + fromPointOffsetXSign * offsetX, y: fromPointOffsetYSign * (marginY + buttonRadius))
-        var toPoint: CGPoint = CGPoint(x:toPointOffsetXSign * (marginX + buttonRadius), y: point.y + toPointOffsetYSign * offsetY)
+        let baseFromPointX = point.x;
+        let baseFromPointY = touchPointPosition == .topLeft || touchPointPosition == .topRight ? 0.0 : size.height;
+        let baseToPointX = touchPointPosition == .topLeft || touchPointPosition == .bottomLeft ? 0.0 : size.width;
+        let baseToPointY = point.y;
+        
+        let fromPoint: CGPoint = CGPoint(x: baseFromPointX + fromPointOffsetXSign * offsetX, y: baseFromPointY + (marginY + buttonRadius) * fromPointOffsetYSign)
+        let toPoint: CGPoint = CGPoint(x:baseToPointX + (marginX + buttonRadius) * toPointOffsetXSign, y: baseToPointY + toPointOffsetYSign * offsetY)
         
         return [fromPoint, toPoint]
-        
     }
     
     private func distanceOfTouchPointToEdges(touchPoint point: CGPoint, inViewWithSize size: CGSize) -> UIEdgeInsets {
+        
         var edgeInsets : UIEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0)
         
         edgeInsets.top = point.y
-        edgeInsets.bottom = size.height - 0
+        edgeInsets.bottom = size.height - edgeInsets.top
         edgeInsets.left = point.x
         edgeInsets.right = size.width - point.x
         

            }
        }
        
        let outerRadius: CGFloat = distance +  buttonRadius * 2;
        let touchPointInset = self.distanceOfTouchPointToEdges(touchPoint: point, inViewWithSize: size)
        
        // This version prioritises to display the buttons to the TOP therefore it does not check touchPointInset.bottom > outerRadius
        if (touchPointInset.top > outerRadius && touchPointInset.right > outerRadius && touchPointInset.top > outerRadius) {
            return [fromAngle, toAngle];
        }
        
        let thresholdPoints = self.thresholdPointsOfButtonsArcInView(withSize: size, atTouchPoint: point);
        let firstPoint = thresholdPoints[0];
        let secondPoint = thresholdPoints[1];
        
        let firstAngle: Double = (Double)(self.angleBetweenHorizontalLineAndLineHasCenterPointAndAnotherPoint(centerPoint: point, anotherPoint: firstPoint))
        let secondAngle: Double = (Double)(self.angleBetweenHorizontalLineAndLineHasCenterPointAndAnotherPoint(centerPoint: point, anotherPoint: secondPoint))
        
        return [firstAngle, secondAngle];
    }

        let verticalLength = fabs(centerPoint.y - anotherPoint.y)
        var angle = atan(verticalLength/horizontalLength)
        
        if isObstubeAngle {
            angle = ((CGFloat)(Double.pi) - angle) * sign
        } else {
            angle = angle * sign
        }
        
