updated functions and main() for the updated watertxt.py module