added solution for hw3 problems 4