Added simple sample code for figure 8