Somewhat working.

TODO: fix recursive J application with local parameters