updated to exercise 6.4