trained the database