How do veins function in the circulatory system?