Add wrap function to prevent long words from breaking template (Exercise 10.6)