add function pulse and the example