Prepositions may sometimes be used to end sentences. For example, "What did you put that there for?" (better English is the alternative: "Why did you put that there?") Example 2: "A pen is a device to write with" (better English is "A pen is a writing device"). In general, because they are links, prepositions belong in the middle of sentences, rather than at the end.