add utils/settings, fix w#6
fix bug in #6
add unittest cases