duckexample src code (with tests)