first solution to 2(b)