added second and third examples using monitor