exercise 1,2 from ex 2
finished ex 3