complete all main heart logic