final revision of problem 1 seems to be in working order