Improved example and unit test