set up most of the database