add solution to hw2 task 4