almost finish the database