fixed printing of functions and example generation