The shape of the action potential differs between the epicardium and the endocardium. Then mesothelial cells form the pericardium and migrate to form most of the epicardium. Initially ICDs were implanted via thoracotomy with defibrillator patches applied to the epicardium or pericardium. Cardiac muscle lies in between the epicardium and the endocardium in the heart. Adults have also been found in nodules on the epicardium of the heart. The wall of the heart is made up of three layers&colon; epicardium, myocardium, and endocardium. Less extensive infarctions are often "subendocardial" and do not affect the epicardium. The intrinsicoid deflection reflects the depolarization vector from the endocardium to the epicardium. The epicardium is largely made of connective tissue and functions as a protective layer. The epicardium is the first layer of the ventricles to repolarize, followed by the myocardium. The epicardium is the layer immediately outside of the heart muscle proper (the myocardium).