Different stages of ECG code implementation