Problem7 and Problem8