proposal solution for exercise 4.