How the cardiac cycle is produced by electrical impulses in the heart