Correct the logic for building the list of strings