Added Example 5 with second type of code structuring