     func drawEquation(_ equation: GraphableEquation, withContext context: CGContext, inRect rect: CGRect, at x: CGFloat)
     {
         let previousX = x - self.interval
-        var rangeContainsPreviousX = false
-        
-        if let range = equation.inputDomain
+        var rangeContainsPreviousX = true
+        
+        if let range = equation.domain
         {
             rangeContainsPreviousX = range.contains(previousX)
             

    // MARK: - GraphableEquation
    
    var drawingColor: UIColor = UIColor.black
    var inputDomain: Range<CGFloat>?
    
    // MARK: - Equation
    
    func compute(withInterval interval: CGFloat, between x1: CGFloat, and x2: CGFloat) -> [Coordinate]
    {
        var coordinates : [Coordinate] = []
        
        for x in stride(from: x1, through: x2, by: interval)
        {
            coordinates.append(Coordinate(x: x, y:  self.compute(at: x)))
        }
        
        return coordinates
    }
    
    func compute(at x: CGFloat) -> CGFloat
    {

    // MARK: - GraphableEquation
    
    var drawingColor: UIColor = UIColor.black
    var domain: Range<CGFloat>?
    
    // MARK: - Equation
    
    func compute(at x: CGFloat) -> CGFloat
    {
        return amplitude * cos((self.period * x) - (self.phaseShift/self.period)) + self.verticalShift
    }
}
