         if idx > -1
           edges.splice(idx, 1)
 
+
       increasedSides
 
     result = quickHullStep(points.filter(notUsed), edgePoints, dividingLine, dividingEdge, 0)
-    if result == 2
-      if dividingEdge != null
-        idx = edges.indexOf(dividingEdge)
-        if idx > -1
-          edges.splice(idx, 1)
+    #if result == 2
+    #  if dividingEdge != null
+    #    idx = edges.indexOf(dividingEdge)
+    #    if idx > -1
+    #      edges.splice(idx, 1)
 
     #ordering edges
     for i in [0..edges.length-1] by 1

    edgePoints.push(points[minX])
    edgePoints.push(points[maxX])
    dividingEdge = new Edge(points[minX], points[maxX])
    edges.push(dividingEdge)

    quickHullStep = (points, edgePoints, dividingLine, dividingEdge, depth) ->
      leftPoints = points.filter(isLeft(dividingLine))


        sidePoints = sidePoints.filter(notUsed)

        paLine = new Line2D(dividingLine.a, max.point)
        paPoints = sidePoints.filter((p) -> paLine.isPointOnTheLeftSide(p) == left)

        pbLine = new Line2D(dividingLine.b, max.point)
        pbPoints = sidePoints.filter((p) -> pbLine.isPointOnTheLeftSide(p) == !left)

        resultA = quickHullStep(paPoints, edgePoints, paLine, dividingEdgeA, depth + 1)
        resultB = quickHullStep(pbPoints, edgePoints, pbLine, dividingEdgeB, depth + 1)
