all of Ex 1 execept last part - normal function