solutions to homework 4