Solved homework 1 problem 1