A system for pacing a heart includes an implantable pulse generator configured to generate electrical impulses for stimulating contraction of cardiac tissue; first, second, third, and fourth leads configured to deliver the electrical impulses to activation sites within the cardiac tissue and to detect electrical activity of the activation sites; and a controller configured to control the delivery of the electrical impulses from each of the first, second, third, and fourth leads.