Second part of Homework 1