solutions for ex1-7