Created sample code to demonstrate use, commented logic.