Solution for Homework 2