what is the purpose of valves in ventricle?