solution to homework 3