         self.registerPrimitives()
     }
 
-    func registerPrimitive(name:String, _ primitiveClosure: ()->Void) -> Int {
-        let index = primitiveTable.endIndex
+    func registerPrimitive(name:String, execute primitiveClosure: ()->Void) -> Int {
+        let index = self.primitiveTable.endIndex
         self.primitiveDictionary[name] = index
-        primitiveTable += primitiveClosure
+        self.primitiveTable += primitiveClosure
         return index
     }
 
     func next() {   // inner interpreter
-        var currentItem = heap[instructionPointer++]
+        var currentItem = self.heap[self.instructionPointer++]
 
         switch currentItem {
         case let .Thread(index):
-            returnStack += Cell.Thread(index: instructionPointer)
-            instructionPointer = index
+            self.returnStack += Cell.Thread(index: instructionPointer)
+            self.instructionPointer = index
 
         case let .Primitive(num):
             self.primitiveTable[num]()
 
         case let .Branch(destinationIndex):
-            instructionPointer = destinationIndex
+            self.instructionPointer = destinationIndex
 
         case let .ZeroBranch(destinationIndex):
             switch self.pop() {
             case let .Literal(value):
                 if (value == 0) {
-                    instructionPointer = destinationIndex
+                    self.instructionPointer = destinationIndex
                 }
             default:
                 self.error()

        self.next()
    }

    func toRPrim() {
        self.toR()
        self.next()
    }

    func fromRPrim() {
        self.fromR()
        self.next()
    }

    func fetchRPrim() {
        self.fetchR()
        self.next()
    }

    func wordsPrim() {
        for (k, v) in self.primitiveDictionary {
            print("\(k) ")
        }

    }

    func registerPrimitives() {
        self.registerPrimitive(";",     execute:{ self.exitPrimitive() })
        self.registerPrimitive("bye",   execute:{ self.exitFlag = true })
        self.registerPrimitive("hello", execute:{ println("hello world!") })
        self.registerPrimitive("dup",   execute:{ self.dupPrimitive() })
        self.registerPrimitive("drop",  execute:{ self.dropPrimitive() })
        self.registerPrimitive("swap",  execute:{ self.swapPrimitive() })
        self.registerPrimitive("nip",   execute:{ self.nipPrimitive() })
        self.registerPrimitive("tuck",  execute:{ self.tuckPrimitive() })
        self.registerPrimitive("over",  execute:{ self.overPrimitive() })
        self.registerPrimitive(">r",    execute:{ self.toRPrimitive() })
        self.registerPrimitive("r>",    execute:{ self.fromRPrimitive() })
        self.registerPrimitive("r@",    execute:{ self.fetchRPrimitive() })
        self.registerPrimitive("+",     execute:{ self.addPrimitive() })
        self.registerPrimitive("-",     execute:{ self.subPrimitive() })
        self.registerPrimitive("*",     execute:{ self.multPrimitive() })
        self.registerPrimitive("/",     execute:{ self.divPrimitive() })
        self.registerPrimitive("*/",    execute:{ self.multDivPrimitive() })
        self.registerPrimitive(".",     execute:{ self.printTopOfStackPrimitive() })
        self.registerPrimitive("@",     execute:{ self.fetchPrimitive() })
        self.registerPrimitive("!",     execute:{ self.storePrimitive() })
        self.registerPrimitive("words", execute:{ self.wordsPrimitive() })
        self.registerPrimitive("0<",    execute:{ self.greaterThanZeroPrimitive() })
        self.registerPrimitive("and",   execute:{ self.andPrimitive() })
        self.registerPrimitive("or",    execute:{ self.orPrimitive() })
        self.registerPrimitive("xor",   execute:{ self.xorPrimitive() })
    }

    func mainLoop() {
        while !self.exitFlag {
            self.next()
        }
    }

    func cellForName(name:String) -> Cell! {
        if let PrimitiveIndex = self.primitiveDictionary[name] {
            return Cell.Primitive(num: PrimitiveIndex)
        } else if let index = self.wordDictionary[name] {
            return Cell.Thread(index: index)
        } else if let value = name.toInt() {
