New function in file DB.cs