fixed minor issues with example 4