corrections and improvements to stacks and lambda abstraction