added water count logic