exercise 6.7 center output