modifcated a method in exercise 2