         
         return ba
     }
-    
+
+
+    /// A private method used to calculate the proper duration of the end cap
+    /// animation.
+    ///
+    /// - parameter fromAngle: The starting angle in radians
+    /// - parameter toAngle: The ending angle in radians.  Can be more then 2*pie in change.
+    /// - return: The CFTimeInterval to be used for the animation
     private func angleRotationDuration(fromAngle: CGFloat, toAngle: CGFloat) -> CFTimeInterval {
         let deltaAngle = abs(toAngle - fromAngle)
         let numberRotations = deltaAngle / CGFloat(2 * M_PI)



extension CustomProgressView {
    
    private func circleAnimation(fromStroke: CGFloat, toStroke: CGFloat, fromAngle: CGFloat, toAngle: CGFloat) -> CABasicAnimation {
        let ba = CABasicAnimation(keyPath: "strokeEnd")
        ba.fromValue = fromStroke

        
        return ba
    }


    /// A private method used to generate the animation for the end cap that rotates
    /// through the desired number of rotations.
    ///
    /// - parameter fromAngle: The starting angle in radians
    /// - parameter toAngle: The ending angle in radians.  Can be more then 2*pie in change.
    /// - return: A CABasicAnimation properly setup for the desired changes.
    private func endCapAnimation(fromAngle: CGFloat, toAngle: CGFloat) -> CABasicAnimation {
        let ba = CABasicAnimation(keyPath: "transform.rotation.z")
        ba.fromValue = fromAngle
