exercise 2 & 3ab

b is unfinished