(Untested) db write functions added. db reads next.