Add tree walking function and simple variables.