exercise4 final version