solution to problem 1 added