Added util.py to include jointly needed functionality