Fixing a stupid; was using "last" instead of "next" looping command