working prototype for subexpressions