updating functions in lib.py to power changewithin.py