in class exercise 3 - partially finished