add a code and example for testing