         
         let runwayPath = UIBezierPath()
         
-        runwayPath.move(to: CGPoint(x: 125, y: 40))
-        runwayPath.addArc(withCenter: CGPoint(x: 90, y: 140), radius: 35, startAngle: 0, endAngle: CGFloat.pi, clockwise: true)
-        runwayPath.move(to: CGPoint(x: 55, y: 140))
-        runwayPath.addArc(withCenter: CGPoint(x: 90, y: 40), radius: 35, startAngle:  CGFloat.pi, endAngle:0, clockwise: true)
+        runwayPath.move(to: CGPoint(x: 125*frameRate, y: 40*frameRate))
+        runwayPath.addArc(withCenter: CGPoint(x: 90*frameRate, y: 140*frameRate), radius: 35*frameRate, startAngle: 0, endAngle: CGFloat.pi, clockwise: true)
+        runwayPath.move(to: CGPoint(x: 55*frameRate, y: 140*frameRate))
+        runwayPath.addArc(withCenter: CGPoint(x: 90*frameRate, y: 40*frameRate), radius: 35*frameRate, startAngle:  CGFloat.pi, endAngle:0, clockwise: true)
 
        
         runwayLayer.path = runwayPath.cgPath
         
-        runwayLayer.lineWidth     = 10.0
+        runwayLayer.lineWidth     = 10.0*CGFloat(frameRate)
         runwayLayer.fillColor     = UIColor.clear.cgColor
         runwayLayer.strokeColor   = UIColor(red: 6/255, green: 122/255, blue: 240/255, alpha: 1).cgColor
         runwayLayer.lineCap       = kCALineCapRound;

    
    fileprivate func animateLayers() {
        
        let shapAnim = CABasicAnimation(keyPath: "strokeEnd")
        shapAnim.fromValue = 0.0
        shapAnim.toValue = 1.0
        shapAnim.duration = 1
        
        runwayLayer.add(shapAnim, forKey: "anim")
        
        let shapAnimStart = CABasicAnimation(keyPath: "strokeStart")
        shapAnimStart.fromValue = 0.0
        shapAnimStart.toValue = 1.0
        shapAnimStart.duration = 1
        shapAnimStart.beginTime = CACurrentMediaTime() + 1
        
        runwayLayer.add(shapAnimStart, forKey: "anim1")
        
        addCircleLayerAnimation(redCircleLayer, fillColor: UIColor.red, withDuration: 1, delay: 0.1)
        addCircleLayerAnimation(yellowCircleLayer, fillColor: UIColor.orange, withDuration: 1, delay: 0.4)
        addCircleLayerAnimation(greenCircleLayer, fillColor: UIColor.green,withDuration: 1, delay: 0.6)
        
    }
    
    func addCircleLayerAnimation(_ toLayer: CALayer, fillColor: UIColor, withDuration duration: CFTimeInterval, delay: CFTimeInterval) {
        
        
        let strokeEndAnim          = CABasicAnimation(keyPath: "strokeEnd")
        strokeEndAnim.fromValue    = 0.0
        strokeEndAnim.toValue      = 1.0
        strokeEndAnim.duration     = 0.4
        strokeEndAnim.beginTime    = delay
        
        let fillColorAnim            = CABasicAnimation(keyPath: "fillColor")
        fillColorAnim.fromValue      = fillColor.cgColor
        fillColorAnim.toValue        = fillColor.cgColor
        fillColorAnim.duration       = 0.20
        fillColorAnim.beginTime      = 0.5 + delay
        
        let redLayerAnim            = CAAnimationGroup()
        redLayerAnim.animations     = [strokeEndAnim, fillColorAnim]
        redLayerAnim.duration       = duration
        redLayerAnim.beginTime      = CACurrentMediaTime()
        redLayerAnim.autoreverses   = true
        redLayerAnim.fillMode       = kCAFillModeForwards
        toLayer.add(redLayerAnim, forKey: "layerAnim")
    }
    
    
}


class HLTrafficLightsIndicatorView: UIView {

    fileprivate var durationRate: Double    = 0.7
    fileprivate var frameRate: CGFloat      = 1

    override func awakeFromNib() {
        super.awakeFromNib()
