I am going through the Fluenz German Program and came to an issue that I don't quite understand. "Welchen Schirm möchten Sie kaufen? Diesen?" is the example sentence I will use. "Welchen" has the "-en" ending as there is both a direct object and a subject in the sentence. That I understand. "Diesen," on the other hand, I have seen with both the "-en" and "-er" ending and was wondering why. What part of the sentence causes this change to the "Diese" that follows?