You're to handle data structures? If you do it wrong, if each bookstore address is duplicated beside the book's entry, tests will pass but you will have migration nightmare very soon.
What you are forgetting here is the essential refactoring step in the loop.
Of course, this all assumes you've got the right architecture for the job.