changed structure of sample_app and finfished chapter 6