The function already gives an index with the action potentials
Just studying the diff command