The valves have two functions:  To allow the blood to flow through the heart smoothly.