     super.viewDidLoad()
     
     
-    self.previousCenter = self.box.center
+
     self.previousCornerRadius = self.box.layer.cornerRadius
     self.previousSize = self.box.frame.size
     let random = Double.sh_random(min: 25, max: 100)
     self.newSize = CGSize(width: random, height: random)
     self.newCenter = CGPoint(x: 320.sh_randomFromZero, y: 480.sh_randomFromZero)
     self.newCornerRadius = 30.sh_randomFromZero
+    self.previousCenter = self.box.center
     
     
     

      self.update()
      
    }
    
    
  }
  

  }
  
  
  func didTap(tap:UITapGestureRecognizer) {
    if(tap.state == .Ended) {
      self.newCenter = tap.locationInView(self.view)
      self.update()
    }
  }
  func update() {
    
    
    Animera.runWithDuration(self.duration) { progress, reversedProgress, isFinished in
      let timedPercentage = self.timingFunctionHandler(progress)
//      self.box.center.x = (self.newCenter!.x * timedPercentage) + (self.box.center.x * (1.0-timedPercentage))
//      self.box.center.y =  (self.newCenter!.y * timedPercentage) + (self.box.center.y * (1.0-timedPercentage))

      self.box.center.x = (self.newCenter!.x * timedPercentage) + (self.box.center.x * (1.0-timedPercentage))
      self.box.center.y =  (self.newCenter!.y * timedPercentage) + (self.box.center.y * (1.0-timedPercentage))

//      self.box.bounds.size.width = (self.newSize!.width * timedPercentage) + (self.previousSize!.width * (1.0-timedPercentage))
//      self.box.bounds.size.height =  (self.newSize!.height * timedPercentage) + (self.previousSize!.height * (1.0-timedPercentage))
      
      self.box.layer.cornerRadius = (self.newCornerRadius! * timedPercentage) + (self.previousCornerRadius! * (1.0-timedPercentage))
      if(isFinished == true) {
        self.timingFunctionHandler = TimingFunctions.randomTimingFunction
        self.previousCornerRadius = self.newCornerRadius
        self.previousSize = self.newSize
        self.newCornerRadius = 20.sh_randomFromZero
//        self.newCenter = CGPoint(x: 320.sh_randomFromZero, y: 480.sh_randomFromZero)
        self.previousCenter = self.box.center
        let random = Double.sh_random(min: 25, max: 100)
        self.newSize = CGSize(width: random, height: random)
//        self.update()
        
      }
      
