     var delay: TimeInterval = 0
     var timing                = kCAMediaTimingFunctionEaseIn
     var from: CGFloat         = 0.0;
-    var to: CGFloat           = CGFloat(-M_PI / 2)
+    var to: CGFloat           = -CGFloat.pi / 2
     var hidden                = true
     configureAnimationItems(.open)
     

      
      animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden)
      
      from   = from == 0.0 ? CGFloat(M_PI / 2) : 0.0;
      to     = to == 0.0 ? CGFloat(-M_PI / 2) : 0.0;
      timing = timing == kCAMediaTimingFunctionEaseIn ? kCAMediaTimingFunctionEaseOut : kCAMediaTimingFunctionEaseIn;
      hidden = !hidden
      delay += durations[index]
    }

      
      animatedView.foldingAnimation(timing, from: from, to: to, duration: durations[index], delay: delay, hidden: hidden)
      
      to     = to == 0.0 ? CGFloat.pi / 2 : 0.0
      from   = from == 0.0 ? -CGFloat.pi / 2 : 0.0
      timing = timing == kCAMediaTimingFunctionEaseIn ? kCAMediaTimingFunctionEaseOut : kCAMediaTimingFunctionEaseIn
      hidden = !hidden
      delay += durations[index]
    }
