update util.h methods, add unit tests for util methods