added a missing let to nondestructive array updates.