adding example code form lab 3.