added a more complete example