debugging this code - searching for source of seg fault
A working version of the water tank - without the seg fault.