             
             // SUBN_V_V (Subtract the first register from the second register and store the result in the first register, borrow flag is set when there is no borrow)
             0x8007: { arg in
-                let registerX = Int(arg & 0x10)
-                let registerY = Int(arg & 0x1)
+                let registerX = Int(arg & 0x0100)
+                let registerY = Int(arg & 0x0010)
                 
                 let valueX = self.V[registerX]
                 let valueY = self.V[registerY]

            
            // LD_DT_V (Set the delayTimer to the value in register V)
            0xF015: { arg in
                let registerX = Int(arg)
                self.delayTimer = self.V[registerX]
            },
            
            // LD_ST_V (Set the soundTimer to the value in register V)
            0xF018: { arg in
                let registerX = Int(arg)
                self.soundTimer = self.V[registerX]
            },
            
            // ADD_I_V (I and the register are added and stored in I)
            0xF01E: { arg in
                let registerX = Int(arg)
                self.I = self.I + UInt16(self.V[registerX])
            },
            
            // LD_F_V (I is set to the address of the corresponding font block representing the value in register V)
            0xF029: { arg in
                let registerX = Int(arg)
                let valueX = self.V[registerX]
                
                // Get the memory offset for this hex number (a single font consists of 5 bytes)

            
            // OR_V_V (OR two registers and store result in first register)
            0x8001: { arg in
                let registerX = Int(arg & 0x0100)
                let registerY = Int(arg & 0x0010)
                
                let valueX = self.V[registerX]
                let valueY = self.V[registerY]
