The heart is located in the mediastinum and is protected by the pericardium. It has four chambers - two atria that receive blood and two ventricles that pump blood out. The heart has three layers - the epicardium, myocardium, and endocardium. It is surrounded by the pericardium and has coronary arteries that supply its own blood flow. The heart has four valves that ensure one-way blood flow through the chambers and out to the lungs and body. It is able to contract rhythmically due to pacemaker cells that generate and conduct electrical signals.