         addBuiltin(name: "cond") { args in
             let condition: LispType = args!.value
             
-            func evaluateOrReturnResult(val: LispType) -> LispType
-            {
-                var rv: LispType
-                
-                switch val {
-                    
-                case .Atom(let a):
-                    if let r = self.env.getVariable(name: a) {
-                        rv = r
-                    } else {
-                        rv = val
-                    }
-                    break
-                    
-                case .LPair(let p):
-                    rv = self.env.evaluate(p: p)
-                    break
-                    
-                default:
-                    rv = val
-                }
-                
-                return rv
-            }
-            
-            let result = evaluateOrReturnResult(val: condition)
+            
+            
+            let result = self.evaluateOrReturnResult(val: condition)
             
             if !valueIsBoolean(val: result) {
                 print("cond requires the first argument to be a boolean.")

            self.env.pushEnvironment(environment: env)
            
            let body: Pair? =  pairFromValue(val: args!.next!.value)!
            var pair = pairFromValue(val: (body?.value)!)
            var rv = LispType.Nil
            
            // Evaluate all of the expressions in the body
            while pair != nil {
                rv = self.env.evaluate(p: pair!)
                pair = pair!.next
            }
            

    override init(env: Environment) {
        super.init(env: env)
        let _ = initBuiltins()
    }
    
    func evaluateOrReturnResult(val: LispType) -> LispType
    {
        var rv: LispType
        
        switch val {
            
        case .Atom(let a):
            if let r = self.env.getVariable(name: a) {
                rv = r
            } else {
                rv = val
            }
            break
            
        case .LPair(let p):
            rv = self.env.evaluate(p: p)
            break
            
        default:
            rv = val
        }
        
        return rv
    }
    
    func initBuiltins() -> [String: BuiltinBody] {
