Making the database work