explain how the heart works