Why are valves important in the heart?