solved prac2 problem1.9