finishing ch5 through the database section