Solution to Chapter 2 problems