Ah, but you have changed the order of operations, which I'm pretty sure was deliberate. You have also removed the second loop, which was probably deliberate as well.