Added examples and improved code clarity.