improved interface and add example