Examples for Chapter 5 and 6

Added the samples used in the chapters code