add some helper functions in util.c