Algorithms Toward a Next Generation Pacemaker