Added a function to utils.py.