redo chapter 6, fixed app