State checking in checking pumping

Added checking to the code that is run during the pumping to make sure
that water is exiting the pipe.