progress on hw2
finished problem 6