db functions are mostly working
db functions are done