prac2 problem1.7 solving