add utils.cpp
add utils.h
add several utility functions
fix typo