add for_each loop to books