fix typos and add columns
add digest logic
db access logic changed(use with-db-connection)
add tests