diff --git a/Language/CIRC/Runtime.hs b/Language/CIRC/Runtime.hs
--- a/Language/CIRC/Runtime.hs
+++ b/Language/CIRC/Runtime.hs
@@ -5,20 +5,23 @@
   , runCIRC
   , Id
   , newId
+  , idId
   ) where
 
 import Control.Monad.State
 
 -- | The CIRC transform monad.  Used to create fresh ids.
-type CIRC = State Int
+type CIRC = State (Int, [(String, Int)])
 
 -- | Evaluates a CIRC transform.
 evalCIRC :: CIRC a -> Int -> a
-evalCIRC = evalState
+evalCIRC a i = evalState a (i, [])
 
 -- | Evaluates a CIRC transform, also returning the fresh next id.
 runCIRC :: CIRC a -> Int -> (a, Int)
-runCIRC = runState
+runCIRC a i = (b, j)
+  where
+  (b, (j, _)) = runState a (i, [])
 
 -- | Identifiers.
 type Id = String
@@ -26,7 +29,17 @@
 -- | Produces a fresh id.
 newId :: CIRC Id
 newId = do
-  id <- get
-  put $ id + 1
-  return $ "__" ++ show id
+  (i, table) <- get
+  put (i + 1, table)
+  return $ "__" ++ show i
+
+-- | Returns a unqiue int for a given id.
+idId  :: Id -> CIRC Int
+idId name = do
+  (i, table) <- get
+  case lookup name table of
+    Nothing -> do
+      put (i + 1, (name, i) : table)
+      return i
+    Just i -> return i
 
diff --git a/circ.cabal b/circ.cabal
--- a/circ.cabal
+++ b/circ.cabal
@@ -1,5 +1,5 @@
 name:                circ
-version:             0.0.2
+version:             0.0.3
 synopsis:            A Compiler IR Compiler.
 description:         A Compiler IR Compiler.
 license:             BSD3
