This example provides a very basic illustration. A real-world scenario would involve more complexity, error checking, and extensive testing.