Ex. d) now runs nicely.

TODO: report, comments in code