add methods for exercise 1
Solutions to Exercise 2