add some help functions in util.c