Arrhythmia Prevention and Termination Algorithms