prettyprint works for funs
nested function call fixed