Go to the location shown in the image below, location at the top of the screenshot. Create a new local variable called Remaining L and set it to a Bool. Then create a new local variable called Item Count L and set it to Integer. Then copy the images below so your section of that code looks the same.

Next go to the location shown in the image below and add the highlighted nodes, location at the top of the screenshot.