   def m(mod) do
     IO.inspect mod.module_info
   end
+
+  @doc """
+  Prints the history
+  """
+  def h do
+    history = List.reverse(Process.get(:__history__))
+    lc {item, index} inlist List.zip(history,
+                            :lists.seq(1,length(history))) do
+      IO.puts "## #{index}:\n#{item[:code]}#=> #{inspect item[:result]}"
+    end
+    nil
+  end
+
+  @doc """
+  Retrieves Nth query's value from the history
+  """
+  def v(n) when n < 0 do
+    history_length = length(Process.get(:__history__))
+    v(history_length + n + 1)
+  end
+  def v(n) do
+    history = List.reverse(Process.get(:__history__))
+    item = :lists.nth(n, history)
+    item[:result]
+  end
 end
  code cache, the instructions counter and needs to
  return a list with the new characters inserted.
  """
  def get(cache, _count) do
    prompt = case cache do
      [] -> "iex> "
      _ -> "...> "
    end
    :unicode.characters_to_list(IO.gets(prompt))

    cache   = config.cache
    code    = cache ++ io.get(cache, counter)

    {new_config, history} =
      try do
        Process.put :__history__, history
        { result, new_binding, scope } =
          Erlang.elixir.eval(code, config.binding, counter, config.scope)
        io.put result
        {config.binding(new_binding).cache('').scope(scope), 
         [[code: code, result: result, binding: new_binding, scope: scope]|history]}
      rescue
        TokenMissingError ->
          config.cache(code)
