Implement program 5.
Fixes.