foreach_book cleaned up code