       :!= -> quote do fn x,y -> x != y end end
     end
     quote do
-      GenServer.call(Blockytalky.UserCode, {:push_fun, :loop, fn ->
+      GenServer.call(Blockytalky.UserState, {:push_fun, :loop, fn ->
         when_sensor_value_compare(unquote(port_id),
           unquote(compare),
           unquote(value), #could be a constant or a var/var history [{iteration,value}...]

  """
  defmacro when_sensor({:in, _m, [port_id, range={:.., _m2, [_left,_right]}]}, do: body) do
  quote do
    GenServer.call(Blockytalky.UserCode, {:push_fun, :loop, fn ->
      when_sensor_value_range(unquote(port_id),
        unquote(range), #could be a constant or a var
        fn -> unquote(body) end)

  end
  defmacro when_sensor({:not_in, _m, [port_id, range={:.., _m2, [_left,_right]}]}, do: body) do
    quote do
      GenServer.call(Blockytalky.UserState, {:push_fun, :loop, fn ->
        when_sensor_value_range(unquote(port_id),
          unquote(range), #could be a constant or a var
          fn -> unquote(body) end,
