Unused variable was removed.
fix: for iterating through list and modifying it in the same loop