improvement to exercise 2
improvements to exercise 3