Moved util.py function into pb_tool.py to simplify distribution