       end) == "********************"
     end
 
-    # test "nested loops" do
-    #   assert capture_io(fn ->
-    #     RPNForthThing.initialize(~w[
-    #       : STAR 42 emit ;
-    #       : DASH 45 emit ;
-    #       : STARDASHES 0 do 2 0 do STAR loop 2 0 do DASH loop loop ;
-    #       5 STARDASHES end
-    #     ])
-    #   end) == "**--**--**--**--**--"
-    # end
+    test "DO LOOP test with I" do
+      assert capture_io(fn ->
+        RPNForthThing.initialize(~w[
+          5 0 do i . loop
+        ])
+      end) == "0 1 2 3 4 "
+    end
+
+    test "nested loops" do
+      assert capture_io(fn ->
+        RPNForthThing.initialize(~w[
+          : STAR 42 emit ;
+          : DASH 45 emit ;
+          : STARDASHES 0 do 2 0 do STAR loop 2 0 do DASH loop loop ;
+          5 STARDASHES end
+        ])
+      end) == "**--**--**--**--**--"
+    end
+
+    test "looping negative numbers in a definition" do
+      assert capture_io(fn ->
+        RPNForthThing.initialize(~w[
+          : SAMPLE  -243 -250 DO  I . LOOP ; SAMPLE
+        ])
+      end) == "-250 -249 -248 -247 -246 -245 -244 "
+    end
+
+    test "multiplication loop" do
+      assert capture_io(fn ->
+        RPNForthThing.initialize(~w[
+          : MULTIPLICATIONS  CR 11 1 DO  DUP I * .  LOOP  DROP ; 7 MULTIPLICATIONS
+        ])
+      end) == "\n7 14 21 28 35 42 49 56 63 70 "
+    end
+
+    test "*/ and R%, sticking to integers and not floats" do
+      assert capture_io(fn ->
+        RPNForthThing.initialize(~w[
+          : R%  10 */  5 +  10 / ;
+          227 32 R% .
+        ])
+      end) == "73 "
+    end
+    
+    test "rand doesn't error" do
+      rand = RPNForthThing.initialize(~w[ rand ])
+      assert rand > 0
+      assert rand < 1
+    end
+
+    test "max" do
+      assert RPNForthThing.initialize(~w[ 5 40 max ]) == 40
+      assert RPNForthThing.initialize(~w[ 40 5 max ]) == 40
+    end
+
+    test "min" do
+      assert RPNForthThing.initialize(~w[ 5 40 min ]) == 5
+      assert RPNForthThing.initialize(~w[ 40 5 min ]) == 5
+    end
+
+    test "floor5" do
+      assert RPNForthThing.initialize(~w[ : FLOOR5 ( n -- n' ) 1- 5 max ; 1 FLOOR5]) == 5
+      assert RPNForthThing.initialize(~w[ : FLOOR5 ( n -- n' ) 1- 5 max ; 10 FLOOR5]) == 9
+    end
 
   end
 else

  # anything else is true... although typically a 1 is returned
  # for truths, boolean tests should compare with 0 (falsity) instead of 1

  def compute([ "=" | remaining_input], [y, x | stack], dict) do
    out = if y == x, do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  def compute([ "<>" | remaining_input], [y, x | stack], dict) do
    out = if y != x, do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  def compute([ "<" | remaining_input], [y, x | stack], dict) do
    out = if x < y, do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  def compute([ ">" | remaining_input], [y, x | stack], dict) do
    out = if x > y, do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  def compute([ "and" | remaining_input], [y, x | stack], dict) do
    out = if ((y != 0) and (x != 0)), do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  def compute([ "or" | remaining_input], [y, x | stack], dict) do
    out = if ((y != 0) or (x != 0)), do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  def compute([ "not" | remaining_input], [x | stack], dict) do
    out = if x == 0, do: 1, else: 0
    compute(remaining_input, [out | stack], dict)
  end

  # def compute([ "?" | remaining_input], stack, dict) do
  #   compute([ "if" | remaining_input], stack, dict)
  # end

  # If-Else-Then
  # Note that this is a prefix function!
  # Usage: test_val is on top of stack. "if <then-clause> else <else-clause> then"
  # puts then-clause on top of instruction stack if test_val != 0, else-clause if test_val == 0.
  def compute([ "if" | remaining_input], [x | stack], dict) do
    {if_and_possibly_else_clause, ["then" | remaining_input]} = Enum.split_while(remaining_input, fn(ins) -> ins != "then" end)
    {if_clause, else_clause} =
      if Enum.any?(if_and_possibly_else_clause, fn ins -> ins == "else" end) do

    end

    test "adding 2 numbers" do
      assert RPNForthThing.initialize(~w[1 2 +]) === 3
    end

    test "subtracting 2 numbers" do
