Update chuck_util_functions.py

refactored.