                 guard let proc = proc as? (Any, Any)->Any? else {
                     throw InterpreterError.SyntaxError("unknown two parameter function")
                 }
-                guard let result = proc(args[0], args[1]) else {
+                guard let result = proc(args[safe: 0] as Any, args[safe: 1] as Any) else {
                     throw InterpreterError.SyntaxError("bad input to two parameter function")
                 }
                 return result

            case let x as Symbol:
                return x
            default:
                throw InterpreterError.SyntaxError("trying to evaluate invalid statement")
            }
        } else if let x = x as? List, x.first as? Symbol == "if" { // conditional
            var test = x[1]
            let conseq = x[2]
            let alt = x[3]

            guard let bool = try eval(&test, withEnvironment: &env) as? Bool else {
                throw InterpreterError.SyntaxError("invalid conditional statement")

                guard let proc = proc as? (Any)->Any? else {
                    throw InterpreterError.SyntaxError("unknown single parameter function")
                }
                guard let result = proc(args[safe: 0] as Any) else {
                    throw InterpreterError.SyntaxError("bad input to single parameter function")
                }
                return result
