added solutions for hw1 problems 7 and 8