changed switch to use a symbol table with inner lambdas