improved solution to excercise 4
improved solution to excercise 2