Updated util.py to support new spec