solution for methods exercise 1