Platyhelminthes of freshwater, like planarias, have an internal environment much more concentrated in solutes than the exterior and so they present a tendency to gain water. These organisms then need a drainage system to avoid cell death caused by excessive water.
The problem is solved by the presence of protonephridia located along longitudinal channels in the animal body. Protonephridia have ciliated cells, the flame cells, that push water outside the body through excretory pores.