Expand function.

Exercise 3-3.