Adding new utility functions to util.py