Changed way to fill in the database and other changes