exercise 4.1 finished in assignment-4