Add all needed database functions
Redo logged filenames