Solve Exercise 3-3: expand()