diff --git a/example.kn b/example.kn
index b8aa6de179768c55f2cc377366e0e12270b8a8f3..f678b6bc71cf5a4ea370f01dfc41d2ee42e81d9b 100644
--- a/example.kn
+++ b/example.kn
@@ -21,7 +21,7 @@ 3%%3
 %%4
 (|!10)+|!10
 
-"x: ",$x,", y: ",$y,", z: ",$z
+,//"x: ",$x,", y: ",$y,", z: ",$z
 |||
 
 Lorem ipsum dolor sit amet adipiscing.
@@ -30,6 +30,8 @@ |||%%4||| is less than |||3%%3|||.
 
 Is |!10 the digits 9-0?  ||||!10||| is the answer.
 
-||||!10||| is the digits 9-0, which we got from |!10.
+||||!10||| is the digits 9-0, which we got from |!10.  Error: |||foo+2|||
 
-If we're lucky, |||(|!10)+|!10||| might be equal to 18.
+If we're lucky, |||(|!10)+|!10||| might be equal to 18.  Is 18 greater than y?  |||18>y|||
+
+What about this? |||a:4+4;a*8||| Hmmm.
diff --git a/kral.k b/kral.k
index c2ec0b26b4d39a4f6cfc413ac63d986a88441576..9ac273151ab1fb5bf0edc7bae3091bea5091c804 100755
--- a/kral.k
+++ b/kral.k
@@ -1,6 +1,6 @@
 #!/usr/bin/env -S /home/phil/build/ngn-k/k
 
-/stringify
+/stringify /TODO: split off into separate library file s.k
 sd:`i!({$x})
 str:{sd[@x][x]}
 sd[`d]:{$x}
@@ -35,7 +35,7 @@ d:$[cgi;"/"/|1_|"/"\`env[`"SCRIPT_PATH"];`env[`PWD]]
 argv:"\/"\`env[`"PATH_INFO"]
 f:$[cgi;*argv;`argv[2]]
 f:$["  "~f@!2;"example.kn";f]
-p:.[{(,"20 text/gemini"),0:d,"/",f};0N;,"51 text/gemini"]
+p:.[{(,"20 text/gemini"),0:d,"/",f};0N;,"51 text/gemini"] /TODO: proper .[] syntax
 
 /process cells
 put:{?[x;1+(y;y);,z]}
@@ -43,13 +43,39 @@ out:{$[0=#y;x;o[put[x;*y;*z];1+1_y;1_z]]}
 
 cl:&'{3{x~"|||"}':x}'[p]
 cl:{x[&~2>1_{(x-y)*x-y}':-2,x]}'cl
-cb:&{1=#x}'cl
+cb:&{x~,0}'cl
 /cb:&{x~"|||"}'p
 $[~0=2!#cb;`err "|||";]
 cb:(_0.5*#cb;2)#cb
 ci:&{(0<#*x)&1<#x}'cl
 g:{$[~0=2!#x;`err "|||";]}'cl[ci] /garbage
 cl[ci]:{(_0.5*#x;2)#x}'cl[ci]
+ss:{(*x)_|((#y)-*|x)_|y}
+e:{.[.:;,x;"E:",]}
+
+ca:(cb,ci)[<*'cb,ci]
+cx:{$[1=#x;`i,,cl[x];2=#x;`b,{,1_x+!y-x}.x]}'ca
+cr:!#cx
+
+cr:{$[`b=*cx[x];{`b,e'p[*|cx[x]]}x;`i=*cx[x];{`i,e'3_'ss[;p[ca[x]]]'*|cx[x]}x]}'cr
+
+b:&{`b=*x}'cx
+i:&{`i=*x}'cx
+
+/TODO: slot results back into text
+
+/TODO: what about duplicate variable names in source code?  may need to prefix vars with e.g. _kral_
+
+/cr:{$[`b=*x;`b,e'p[*|x];`i=*x;`i,"foo"]}'cx
+
+/ce:{$[2=#x;{p[1_x+!y-x]}.x;1=#x;{3_'ss[;p[x]]'cl[x]}[x]]}'ca
+/cr:str''{.[.:;,x;"Err: ",]}''ce
+/il:{3_'ss[;p[x]]'cl[x]}'ci
+
+/TODO: handle line breaks within inline code?
+
+/TODO: make this an SCGI process and IPC calls
+
 /ci:{(*x)+1_!-/|x}'cb
 /il:&3<{+/"|"=x}'[p] /inlines
 /ci:(ci,,'il)@<*'ci,il
