Added first part of problem 2.