Mainly add accessory functions in utils.py