update pulse function