almost finished problem set 4