anchor.diff:  	{ok, Val} -> rnf(T, Functions, [Val|Out])
       end.
   b2i(X) -> list_to_integer(binary_to_list(X)).
  -to_opcodes([<<":b">>|[B|R]], Functions, Out) ->
  +to_opcodes([<<"binary">>|[B|R]], Functions, Out) ->
       to_opcodes(R, Functions, [base64:decode(B)|Out]);
  -to_opcodes([<<":i">>|[I|R]], Functions, Out) ->
  +to_opcodes([<<"integer">>|[I|R]], Functions, Out) ->
       to_opcodes(R, Functions, [{integer, b2i(I)}|Out]);
  -to_opcodes([<<":f">>|[T|[B|R]]], Functions, Out) ->
  +to_opcodes([<<"fraction">>|[T|[B|R]]], Functions, Out) ->
       to_opcodes(R, Functions, [{f, b2i(T), b2i(B)}|Out]);
   to_opcodes([<<"false">>|R], Functions, Out) ->
       to_opcodes(R, Functions, [false|Out]);
  
positive.code: flip(X) -> flip(X, []).
  flip([], Out) -> Out;
  flip([H|T], Out) -> flip(T, [H|Out]).
  testA() ->
      A = compile(<<"
  : square dup * ; 
  :i 2 square call
  ">>),
      true = [4] == language:run(A, 1000).
  testB() ->
      B = compile(<<"
  : square dup * ; 
  : quad square call square call ; 
  :i 2 quad call
  ">>),
      true = [16] == language:run(B, 1000).
  testC() ->
      C = compile(<<"
  : main dup :i 0 > if :i 1 - :i 0 swap recurse call else drop then ;
  :i 5 main call
  ">>),
      true = [0,0,0,0,0] == language:run(C, 1000).
  testD() ->
      E = compile(<<"
  	     :b qfPbi+pbLu+SN+VICd2kPwwhj4DQ0yijP1tM//8zSOY= hash :b 6DIFJeegWoFCARdzPWKgFaMGniG5vD8Qh+WgPZBb5HQ=  ==
  	     ">>),
      [true] = language:run(E, 1000).
  testF(EPub, Priv) ->
      Sig0 = base64:encode(sign:sign(<<"abc">>, Priv)),
      F = compile(<< <<" :b ">>/binary, Sig0/binary,
        <<"    :b YWJj
  	     :b ">>/binary,  EPub/binary, <<"
  	     verify_sig
  	     ">>/binary >>),
      [true] = language:run(F, 1000).
  testG(EPub, Priv) ->
  % this is a weighted multisig. The first 2 signatures are worth 3, and the last is worth 2. you need 6 total to pass.
      Acode = << <<"
  	 :b YWJj
  	 :b ">>/binary, EPub/binary,
  		   <<" verify_sig ">>/binary >>,
      Bcode = << Acode/binary, <<" rot ">>/binary >>,
      A = compile(Acode),
      Sig = sign:sign(<<"abc">>, Priv),
      [true] = language:run([Sig|A], 1000),
      B = compile(<< Bcode/binary, Bcode/binary, Bcode/binary, <<"
  if :i 3 else :i 0 then rot 
  if :i 3 else :i 0 then rot 
  if :i 2 else :i 0 then 
  + + :i 6 >
         ">>/binary >>),
      [true] = language:run([Sig|[Sig|[Sig|B]]], 1000).
  verify_sig() -> <<" verify_sig not if crash else then ">>.
  commit_reveal(B) ->
      C = list_to_binary(integer_to_list(B)),
      << <<" :i 3 match :i ">>/binary, C/binary, <<" drop :i -1 not if crash else then ">>/binary >>.
  testH(EPub, Priv) -> 
  %This is for commit reveal. The nonce for they are required to include, which is custom for this round. it is a very big random number, to avoid collisions, is 1337
  %The number they committed to in secret is 55.
      Func = <<" :i 1337 drop :i 55">>,
      %Func = <<" :i 0 == if :i 55 else :i 1337 then ">>,%Calling the function with an input of 0 must result in the secret. Callint it with a 1 must result in the big number that identifies this round of validating.
      DFunc = << <<" : func " >>/binary, Func/binary, <<" ; 
  		 :b ">>/binary >>,
      C = hash:doit(compile(Func)),
      Sig2 = base64:encode(sign:sign(C, Priv)),
      Match = commit_reveal(1337),
      %Match = <<" :i 3 match :i 1337 drop :i -1 ">>,
      D = compile(<< DFunc/binary,  Sig2/binary,  
   <<" func dup tuck :b ">>/binary, EPub/binary, (verify_sig())/binary,
        <<" dup ">>/binary, Match/binary, <<"
            call ">>/binary >>),
      [55] = language:run(D, 1000).
  testI(EPub, Priv) ->
  
negative.code:     to_opcodes(R, F, [1|Out]);
  to_opcodes([<<"hash">>|R], F, Out) ->
      to_opcodes(R, F, [0|Out]);
  to_opcodes([<<"verify_sig_or_die">>|R], F, Out) ->
      X = [19, 18, 28, 17, 23, 1],%in reverse order because Out is all reverse.
      to_opcodes(R, F, X ++ Out);
  to_opcodes([<<"commit_reveal">>|[C|[A|R]]], F, Out) ->
      %" integer 3 match D drop integer -1 not if crash else then "
      %This opcode verifies that a hash references a function of the commit-reveal variety. If not, it crashes.
      D  = flip(to_opcodes([C, A], F, [])),%C, A could be a binary, or an integer.
      X = [19, 18, 28, 17, 23, {integer, -1}, 10] ++ D ++ [42, {integer, 3}],
      to_opcodes(R, F, X ++ Out);
  to_opcodes([], _, Out) -> flip(Out);
  to_opcodes([Name|R], Functions, Out) ->
      case dict:find(Name, Functions) of
  