Modified exercise 1 as well added exercise2