modified files to work with new database