 		circleAnimationGroup.animations = [circleStrokeEnd]
 		circle.addAnimation(circleAnimationGroup, forKey: "circleStrokeEnd")
 		
-		var trailCircleColor = CABasicAnimation(keyPath: "opacity")
+		let trailCircleColor = CABasicAnimation(keyPath: "opacity")
 		trailCircleColor.duration = animationDuration
 		if selected {
 			trailCircleColor.fromValue = NSNumber(float: 0.0)

		if layer == self.layer {
			
			var offset: CGPoint = CGPointZero
			var radius = fmin(self.bounds.width, self.bounds.height) / 2
			offset.x = (self.bounds.width - radius * 2) / 2.0
			offset.y = (self.bounds.height - radius * 2) / 2.0
			
			CATransaction.begin()
			CATransaction.setDisableActions(true)
			
			var ovalRect = CGRectMake(offset.x, offset.y, radius * 2, radius * 2)
			
			var circlePath = UIBezierPath(ovalInRect: ovalRect)
			trailCircle.path = circlePath.CGPath
			
			circle.transform = CATransform3DIdentity

	}
	
	private func addAnimationsForSelected(selected: Bool) {
		let circleAnimationDuration = animationDuration * 0.5
		
		let checkmarkEndDuration = animationDuration * 0.8
		let checkmarkStartDuration = checkmarkEndDuration - circleAnimationDuration
		let checkmarkBounceDuration = animationDuration - checkmarkEndDuration
		
		let checkmarkAnimationGroup = CAAnimationGroup()
		checkmarkAnimationGroup.removedOnCompletion = false
		checkmarkAnimationGroup.fillMode = kCAFillModeForwards
		checkmarkAnimationGroup.duration = animationDuration
		checkmarkAnimationGroup.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear)
		
		let checkmarkStrokeEnd = CAKeyframeAnimation(keyPath: "strokeEnd")
		checkmarkStrokeEnd.duration = checkmarkEndDuration + checkmarkBounceDuration
		checkmarkStrokeEnd.removedOnCompletion = false
		checkmarkStrokeEnd.fillMode = kCAFillModeForwards
