         gradient.frame = self.view.frame
         gradient.colors = [topGradient, bottomGradient]
         self.view.layer.insertSublayer(gradient, atIndex: 0)
-        
+    }
+}
+
+// MARK: - View LifeCycle
+extension BikeAnalysisViewController {
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        mapView.delegate = self
+        mapView.layer.cornerRadius = 4
+        setNavigation()
+        setupBackground()
+        setLabel()
+        addPolyLineToMap()
     }
     
+    override func viewWillAppear(animated: Bool) {
+        super.viewWillAppear(animated)
+        TrackingManager.sharedManager.createTrackingScreenView("view_in_record_result")
+    }
+    
+    override func didReceiveMemoryWarning() {
+        super.didReceiveMemoryWarning()
+    }
+}
+
+// MARK: - Map
+extension BikeAnalysisViewController {
     func mapRegion() -> MKCoordinateRegion {
         let initialLoc = routes.first!
         

        
        let calStr = Int(weight * distance * 0.001 * 1.036)
        caloriesLabel.text = String(calStr) + " kcal"
        
    }
    
    func setupBackground() {
        
        self.view.backgroundColor = UIColor.mrLightblueColor()
        let topGradient = UIColor(red: 0, green: 0, blue: 0, alpha: 0.60).CGColor
        let bottomGradient = UIColor(red: 0, green: 0, blue: 0, alpha: 0.40).CGColor

        //        self.mapView.setVisibleMapRect(polyline.boundingMapRect, animated: true)
        self.mapView.addOverlay(polyline)
        self.mapView.region = mapRegion()
    }
    
    func mapView(mapView: MKMapView, rendererForOverlay overlay: MKOverlay) -> MKOverlayRenderer{
