Fixed bugs with example 4.
Added initial attempt at example 5.