     }
     
     func update(cell: GameOfLifeCellState) {
-        let cellStateDelay = cell.isAlive ? 0.0 : (self.stepPeriod * 0.15)
-        
-        let distanceFromWaveOrigin = CellView.waveOrigin.distance(to: self.frame.origin)
-        let maxDistanceFromWaveOrigin = CellView.waveOrigin.distance(to: self.superview!.frame.size.point)
+        let waveOrigin = CGPoint(
+            x: self.superview!.frame.width / 2.0,
+            y: self.superview!.frame.height / 2.0
+        )
+
+        let distanceFromWaveOrigin = waveOrigin.distance(to: self.frame.origin)
+        let maxDistanceFromWaveOrigin = waveOrigin.distance(to: self.superview!.frame.size.point)
         let waveDistanceDelayProportion = distanceFromWaveOrigin / maxDistanceFromWaveOrigin
         
+        let cellStateDelay = cell.isAlive ? 0.0 : (self.stepPeriod * 0.15)
         let delay = cellStateDelay + (self.stepPeriod * 0.55 * waveDistanceDelayProportion)
         let animationStartTime = DispatchTime.now() + Double(delay)
         

import Cocoa

class CellView: NSView {
    
    private static let waveOrigin = CGPoint(x: 0.0, y: 0.0)
    
    private static let deadColor = NSColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0).cgColor
    private static let aliveColor = NSColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0).cgColor

            let animation = CABasicAnimation(keyPath: "backgroundColor")
            animation.fromValue = layer.backgroundColor
            animation.toValue = newColor
            animation.duration = Double(self.stepPeriod * 0.25)

            layer.add(animation, forKey: nil)
            
