started hw3

all but last function of exercise 1