add new helper functions in util.c