loop through books with foreach loop